package com.example.demo.config;

import cn.com.antcloud.api.AntFinTechApiClient;
import cn.com.antcloud.api.AntFinTechProfile;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class AntConfig {
    @Value("${zhima.endpoint}")
    private String endPoint;
    @Value("${zhima.accessKey}")
    private String accessKey;
    @Value("${zhima.secret}")
    private String secret;

    @Bean
    public AntFinTechApiClient getAntClient() {
        // 初始化客户端
        AntFinTechProfile profile = AntFinTechProfile.getProfile(
                endPoint,
                accessKey,
                secret
        );
        return new AntFinTechApiClient(profile);
    }
}
